package com.dddd.blog.blogcommon.controller;

import lombok.Data;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ModelAttribute;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;


/**
 * @author 喵星球的大橘
 * 控制器的基类
 */
@Data
public class BaseController {

    private Logger logger = LoggerFactory.getLogger(getClass());

    private HttpServletRequest request;

    private HttpServletResponse response;

    private HttpSession session;

    @ModelAttribute
    public void buildRequestAndResponse(HttpServletRequest request,HttpServletResponse response,HttpSession session){
        this.request = request;
        this.response = response;
        this.session = session;
    }
}
